<?php

$response = 'RESULT=126&PNREF=V35A1E1A774D&RESPMSG=Under review by Fraud Service&AUTHCODE=758PNI&AVSADDR=Y&AVSZIP=N&CVV2MATCH=Y&IAVS=N&PREFPSMSG=Review: More than one rule was triggered for Review&POSTFPSMSG=Review: More than one rule was triggered for Review"';

			if ( !is_array( $response ) ) { 
				$res = explode( '&', $response );
				$response = array();
				foreach( $res as $key => $val ) { 
					$out = explode( '=', $val );
					$response[ $out[0] ] = $out[1];
				}
			}

var_dump($response);
die;

$post = 'PARTNER=PayPal&USER=simpler123&PWD=Marke123&VENDOR=simpler123&TENDER=C&ACCT=4111111111111111&CVV2=111&EXPDATE=0215&TRXTYPE=S&AMT=41.13&CURRENCY=USD&CUSTIP=127.0.0.1&FIRSTNAME=Mark&LASTNAME=Edwards&STREET=123+Street&CITY=Fort+collins&STATE=CO&ZIP=80525&COUNTRY=US&INVNUM=420';

			$headers = array(
				'Content-Type' => 'text/namevalue',
				'X-VPS-REQUEST-ID' => uniqid(),
				'X-VPS-CLIENTTIMEOUT' => 45,
				'X-VPS-VITCLIENTCERTIFICATION-ID' => 'code generated guid',
				'X-VPS-VITINTEGRATION-PRODUCT' => 'WooCommerce Payflow Pro',
				'X-VPS-VITINTEGRATION-VERSION' => 0.1,
				'X-VPS-VIT-OS-NAME' => 'Windows XP',
				'X-VPS-VIT-OSVERSION' => 5.1,
				'X-VPS-VIT-RUNTIMEVERSION' => phpversion(),
			);

			$ch = curl_init();

			//curl_setopt( $ch, CURLOPT_URL, 'https://test-payflow.verisign.com' );

			//curl_setopt( $ch, CURLOPT_URL, 'https://payflowpro.paypal.com' );

			curl_setopt( $ch, CURLOPT_URL, 'https://pilot-payflowpro.paypal.com' );

			curl_setopt( $ch, CURLOPT_HTTPHEADER, $headers );
			curl_setopt( $ch, CURLOPT_HEADER, 1 );
			curl_setopt( $ch, CURLOPT_POST, 1 );
			curl_setopt( $ch, CURLOPT_POSTFIELDS, $post );
			curl_setopt( $ch, CURLOPT_RETURNTRANSFER, 1 );
			curl_setopt( $ch, CURLOPT_TIMEOUT, 90 );
			curl_setopt( $ch, CURLOPT_CONNECTTIMEOUT, 30 );
			curl_setopt( $ch, CURLOPT_FOLLOWLOCATION, 0 );
			curl_setopt( $ch, CURLOPT_SSL_VERIFYPEER, 0 );
			curl_setopt( $ch, CURLOPT_SSL_VERIFYHOST,  2 ); 

			$response = curl_exec ($ch);

			if ( $response === false )
				$cerr = curl_error( $ch );


var_dump($response);
echo "\n\n $cerr \n\n"
?>
